<?php
use app\middleware\JwtAuth;
use app\middleware\Cors;
use think\facade\Route;

// 文件上传
Route::post('common/upload', 'Utils/upload')->allowCrossDomain();
// 用户路由
Route::group('user', function () {
//    用户注册
	Route::post('register', 'HomeMuser/register');
//    用户登录
	Route::post('login', 'HomeMuser/login');
	Route::post('info', 'HomeMuser/info')->middleware(JwtAuth::class,Cors::class);
	Route::get('nav/list', 'HomeMusernav/list');
})->prefix('user/');

//    获取季节最需
Route::get('mostneeded/list', 'HomeMostneeded/list')->allowCrossDomain();
//    获取首页导航
Route::get('nav/list', 'HomeNav/list')->allowCrossDomain();

// 需求管理
Route::group('requirement',function(){
	Route::get('list', 'HomeRequirement/list');
	Route::post('add', 'HomeRequirement/add');
	Route::post('udp', 'HomeRequirement/update');
	Route::post('del', 'HomeRequirement/del');
})->prefix('requirement/')->middleware(JwtAuth::class,Cors::class);

// 需求评论管理
Route::group('requicomment',function(){
	Route::get('list', 'HomeRequicomment/list');
	Route::post('add', 'HomeRequicomment/add');
	Route::post('udp', 'HomeRequicomment/update');
	Route::post('del', 'HomeRequicomment/del');
})->prefix('requicomment/')->middleware(JwtAuth::class,Cors::class);

// 兑换商品管理
Route::group('exchanmall',function(){
	
	Route::get('list', 'HomeExchanmall/list');
	Route::post('add', 'HomeExchanmall/add');
	Route::post('udp', 'HomeExchanmall/update');
	Route::post('del', 'HomeExchanmall/del');
})->prefix('exchanmall/')->middleware(JwtAuth::class)->allowCrossDomain();



